package com.kede.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Data;

/**
 * 物资门店关联表
 * @TableName t_supplies_store
 */
@TableName(value ="t_supplies_store")
@Data
public class SuppliesStoreDomain implements Serializable {
    /**
     * 
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 门店id
     */
    @TableField(value = "store_id")
    private Integer storeId;

    /**
     * 初始给到门店的数量
     */
    @TableField(value = "init_num")
    private Integer initNum;

    /**
     * 物资id
     */
    @TableField(value = "supplie_id")
    private Integer supplieId;

    /**
     * 物资名称 做冗余处理
     */
    @TableField(value = "supplie_name")
    private String supplieName;

    /**
     * 当前剩余的数量
     */
    @TableField(value = "curr_num")
    private Integer currNum;

    /**
     * 经度
     */
    @TableField(value = "lng")
    private String lng;

    /**
     * 维度
     */
    @TableField(value = "lat")
    private String lat;

    /**
     * 
     */
    @TableField(value = "create_by")
    private String createBy;

    /**
     * 
     */
    @TableField(value = "update_by")
    private String updateBy;

    /**
     * 
     */
    @TableField(value = "create_time")
    private LocalDateTime createTime;

    /**
     * 
     */
    @TableField(value = "update_time")
    private LocalDateTime updateTime;

    /**
     * 物资信息
     */
    @TableField(exist = false)
    private SuppliesDomain supplies;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SuppliesStoreDomain other = (SuppliesStoreDomain) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getStoreId() == null ? other.getStoreId() == null : this.getStoreId().equals(other.getStoreId()))
            && (this.getInitNum() == null ? other.getInitNum() == null : this.getInitNum().equals(other.getInitNum()))
            && (this.getSupplieId() == null ? other.getSupplieId() == null : this.getSupplieId().equals(other.getSupplieId()))
            && (this.getSupplieName() == null ? other.getSupplieName() == null : this.getSupplieName().equals(other.getSupplieName()))
            && (this.getCurrNum() == null ? other.getCurrNum() == null : this.getCurrNum().equals(other.getCurrNum()))
            && (this.getLng() == null ? other.getLng() == null : this.getLng().equals(other.getLng()))
            && (this.getLat() == null ? other.getLat() == null : this.getLat().equals(other.getLat()))
            && (this.getCreateBy() == null ? other.getCreateBy() == null : this.getCreateBy().equals(other.getCreateBy()))
            && (this.getUpdateBy() == null ? other.getUpdateBy() == null : this.getUpdateBy().equals(other.getUpdateBy()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getStoreId() == null) ? 0 : getStoreId().hashCode());
        result = prime * result + ((getInitNum() == null) ? 0 : getInitNum().hashCode());
        result = prime * result + ((getSupplieId() == null) ? 0 : getSupplieId().hashCode());
        result = prime * result + ((getSupplieName() == null) ? 0 : getSupplieName().hashCode());
        result = prime * result + ((getCurrNum() == null) ? 0 : getCurrNum().hashCode());
        result = prime * result + ((getLng() == null) ? 0 : getLng().hashCode());
        result = prime * result + ((getLat() == null) ? 0 : getLat().hashCode());
        result = prime * result + ((getCreateBy() == null) ? 0 : getCreateBy().hashCode());
        result = prime * result + ((getUpdateBy() == null) ? 0 : getUpdateBy().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", storeId=").append(storeId);
        sb.append(", initNum=").append(initNum);
        sb.append(", supplieId=").append(supplieId);
        sb.append(", supplieName=").append(supplieName);
        sb.append(", currNum=").append(currNum);
        sb.append(", lng=").append(lng);
        sb.append(", lat=").append(lat);
        sb.append(", createBy=").append(createBy);
        sb.append(", updateBy=").append(updateBy);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}